package com.gmail.jaredjeya.awesomeplatformer.model;

import java.util.ArrayList;

import android.content.Context;

import com.gmail.jaredjeya.awesomeplatformer.model.entity.mob.Player;
import com.gmail.jaredjeya.awesomeplatformer.model.level.Level;
import com.gmail.jaredjeya.awesomeplatformer.model.sprites.Sprite;

public class Game{
	
	public ArrayList<Level> levels;
	
	
	public Player player;
	private InputHandler inputHandler;
	
	private int level;
	
	
	public Game(Context context) {
		inputHandler = new InputHandler(context);
	}
	
	public void setup(Context context) {
		levels = new ArrayList<Level>();
		levels.add(new Level("levels/level.bmp", context));
		level = 0;
		player = new Player(Sprite.playerSprite, getCurrentLevel().spawnX, getCurrentLevel().spawnY, inputHandler);
	}
	
	public void update() {
		player.update(this);
		getInputHandler().update();
	}
	
	public Level getCurrentLevel() {
		return levels.get(level);
	}

	public InputHandler getInputHandler() {
		return inputHandler;
	}

}
